<?php
header('Content-type: text/html; charset=utf-8');
include_once($_SERVER["DOCUMENT_ROOT"]."/public/function.php");
$config = include_once($_SERVER["DOCUMENT_ROOT"]."/public/config.php");

$id = $_POST['id'];
$res = update($config,'haoyou',"where id={$id}");

if($res){
    echo '<script>alert("修改成功！");window.location.href="index.php"</script>';
}else{
    echo $sql; die;
    echo '<script>alert("修改失败！");window.location.href="index.php"</script>';
    
}

?>